import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home/Home'
import Index from '@/components/Home/Index/Index'
import Article from '@/components/Home/Article/Article'
import Mood from '@/components/Home/Mood/Mood'
import Tool from '@/components/Home/Tool/Tool'
import About from '@/components/Home/About/About'
// 单独页面
import EditArticle from '@/components/Article/EditArticle'//新建文章
import NewArticle from '@/components/Article/NewArticle'//新建文章
import ArticleDetail from '@/components/Article/ArticleDetail'//文章详情
//后台管理
import Console from '@/components/Console/Console'
import Account_adm from '@/components/Console/Account/Account_adm'
import Account_user from '@/components/Console/Account/Account_user'
import Article_B from '@/components/Console/Article/Article'
import Tool_B from '@/components/Console/Article/Tool'
import Image from '@/components/Console/Image/Image'
import Mood_B from '@/components/Console/Mood/Mood'
import Sensitive from '@/components/Console/Sensitive/Sensitive'




Vue.use(Router)

export default new Router({
	routes: [
		{
			path: '/home',
			name: '博客用户页面',
			component: Home,
			children: [{
				path: '/index',//首页
				component: Index,
				name: 'Index'
			},
			{
				path: '/article',//文章
				component: Article,
				name: 'Article'
			},
			{
				path: '/mood',//心情
				component: Mood,
				name: 'Mood'
			},
			{
				path: '/tool',//工具
				component: Tool,
				name: 'Tool'
			},
			{
				path: '/about',//关于
				component: About,
				name: 'About'
			},

			]
		},
		// 后台管理
		{
			path: '/console',
			component: Console,
			name: 'Console',
			meta: {
				requireAuth: true,  // 该路由项需要权限校验
			},
			children: [
				//账号
				{
					path: '/account_adm',//管理员用户
					component: Account_adm,
					name: 'Account_adm'
				},
				{
					path: '/account_user',//普通用户
					component: Account_user,
					name: 'Account_user'
				},
				// 文章
				{
					path: '/tool_b',//工具
					component: Tool_B,
					name: 'Tool_B'
				},
				{
					path: '/article_b',//文章
					component: Article_B,
					name: 'Article_B'
				},
				{
					path: '/image',//轮播图管理
					component: Image,
					name: 'Image'
				},
				{
					path: '/mood_b',//心情管理
					component: Mood_B,
					name: 'Mood_B'
				},
				{
					path: '/sensitive',//敏感词管理
					component: Sensitive,
					name: 'Sensitive'
				}
			]
		},
		{
			path: '/newArticle',//新增文章
			component: NewArticle,
			name: 'NewArticle'
		},
		{
			path: '/editArticle',//编辑文章
			component: EditArticle,
			name: 'EditArticle'
		},
		{
			path: '/articleDetail',//文章详情
			component: ArticleDetail,
			name: 'ArticleDetail'
		},
		{
			path: '*',
			redirect: '/index'
		} /*默认跳转路由*/
	]
})
